package com.tanhua.manager.exceptions;

//统一异常处理的
 
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice  //处理在Controller层向上跑的异常
public class BasicExceptionAdvice {

   @ExceptionHandler(value = TanhuaException.class)
    public ResponseEntity handlerException(TanhuaException e){
        e.getStackTrace();
        System.out.println("已经进入到了统一异常处理中............");
        return ResponseEntity.status(e.getStatusCode()).body(e.getMessage());
    }


}
